package com.sgcc.system.api.factory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.sgcc.common.core.web.domain.AjaxResult;
import com.sgcc.system.api.RemotePostService;
import com.sgcc.system.api.domain.SysPost;

import feign.hystrix.FallbackFactory;

/**
 * 用户服务降级处理
 * 
 * @author sgcc
 */
@Component
public class RemotePostFallbackFactory implements FallbackFactory<RemotePostService>
{
    private static final Logger log = LoggerFactory.getLogger(RemotePostFallbackFactory.class);

    @Override
    public RemotePostService create(Throwable throwable)
    {
        log.error("用户服务调用失败:{}", throwable.getMessage());
        return new RemotePostService()
        {

			@Override
			public AjaxResult getInfoIsc(String postId) {
				// TODO Auto-generated method stub
				return AjaxResult.error("查询岗位失败，请稍后在试~");
			}

			@Override
			public AjaxResult addIsc(SysPost post) {
				// TODO Auto-generated method stub
				return AjaxResult.error("新增岗位失败，请稍后在试~");
			}

			@Override
			public AjaxResult editIsc(SysPost post) {
				// TODO Auto-generated method stub
				return AjaxResult.error("修改岗位信息，请稍后在试~");
			}

			

			
        };
    }
}
